#!/usr/bin/perl
$fred[0] = "yabba";
$fred[1] = "dabba";
$fred[2] = "doo";
print "$fred[0]\n";
$fred[2] = "diddley";
$fred[1] .= "whatsis";
$number = 2.71828;
print "$fred[$number - 1]\n";# Same as printing $fred[1]


$rocks[0]  = 'bedrock';      # One element...
$rocks[1]  = 'slate';        # another...
$rocks[2]  = 'lava';         # and another...
$rocks[3]  = 'crushed rock'; # and another...
$rocks[99] = 'schist';       # now there are 95 undef elements
$end = $#rocks;                  # 99, which is the last element's index "$#rocks is last element of array"
print "$#rocks\n";
print "$rocks[-1]\n";
print "$rocks[-97]\n";
print "$rocks[-98]\n";
print "$rocks[-99]\n";


